<template>
  <div class="myorder">
    <div>
      <el-menu
          style="border-radius: 10px 10px 0 0"
          default-active="Unpaid"
          class="el-menu-demo"
          mode="horizontal"
          background-color="#f3d6d2"
          text-color="#fff"
          active-text-color="#fea64c"
          @select="handleSelect"
      >
        <el-menu-item index="Unpaid">未付款</el-menu-item>
        <el-menu-item index="notShipped">未发货</el-menu-item>
        <el-menu-item index="Shipped">已发货</el-menu-item>
        <el-menu-item index="toEvaluate">待评价</el-menu-item>
        <el-menu-item index="completed">已完成</el-menu-item>
      </el-menu>
      <!--
      <el-tabs
          v-model="activeName"
          type="card"
          class="demo-tabs"
          @tab-click="handleClick"
      >
        <el-tab-pane label="User" name="first">User</el-tab-pane>
        <el-tab-pane label="Config" name="second">Config</el-tab-pane>
        <el-tab-pane label="Role" name="third">Role</el-tab-pane>
        <el-tab-pane label="Task" name="fourth">Task</el-tab-pane>
      </el-tabs>
      -->
    </div>
    <div class="container">
      <!--订单信息-->
      <div style="padding: 10px;">
        <div class="titleInfo">
          <!--订单信息-->
          <div class="RThead">
            <div>订单号</div>
            <div>下单时间</div>
            <div>订单状态</div>
            <div>应付款</div>
            <div>操作</div>
          </div>
          <div class="content">
            <div>174674346748</div>
            <div>2022-9-20 12:46</div>
            <div>未支付</div>
            <div>￥9999</div>
            <div>
              <el-link type="success">支付</el-link>
              <el-link type="danger">取消</el-link>
              <el-link type="primary" @click="goTO('/orderDetail')">查看</el-link>
            </div>
          </div>
        </div>
        <div class="productInfo">
          <div class="goods-detail-item" v-for="(item,index) in 4" :key="index">
            <div class="goods-detail-item-top">
              <img src="http://lixinghe.meimeng.eu.org/flower/image/20141006231606_CrJmu.jpeg" alt="图片走丢了">
            </div>
            <!--商品信息-->
            <div class="goods-info">
              <!--              内容，名字-->
              <div class="title">
                <a >
                  夏日の花
                </a>
              </div>
              <div class="operate">
                <a >
                  数量 1
                </a>
                <a>
                  单价：99
                </a>
              </div>
            </div>
          </div>
        </div>
        <el-divider border-style="dashed">
          <el-icon color="#c9adcb" size="30px"><Tickets /></el-icon>
        </el-divider>
      </div>
      <el-pagination
          style="justify-content: center;margin: 20px 0"
          background
          layout="prev, pager, next"
          :total="50"
          class="mt-4"
      />
    </div>
  </div>
</template>

<script setup>
  import {ref} from 'vue'
  import router from "@/router";
  const handleSelect = (v) => {
    console.log(v);
  }

  const activeName = ref('first')

  const handleClick = (tab, event) => {
    console.log(tab, event)
  }

  const goTO = (item) => {
    router.push(item)
  }
</script>

<style scoped lang="scss">
  .container {
    /*border: 1px solid red;*/
    .titleInfo {
      box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.2);
      border-radius: 10px;
    }
    .RThead {
      display: flex;
      padding: 10px 0;
      justify-content: space-around;
      div {
        text-align: center;
        flex: 1;
      }
    }
    .content {
      padding: 10px 0;
      display: flex;
      font-size: 14px;
      justify-content: space-around;
      div {
        text-align: center;
        flex: 1;
      }
      div:last-child {
        display: flex;
        justify-content: space-evenly;
      }
    }
    .productInfo {
      display: flex;
      justify-content: center;
      flex-flow: wrap;
    }
  }
  .goods-detail-item {
    display: inline-block;
    position: relative;
    width: 180px;
    text-align: center;
    height: 250px;
    overflow: hidden;
    margin: 10px;
    border: 1px solid gainsboro;
    /* box-shadow: 0 4px 8px 0 rgb(0 0 0 / 20%), 0 6px 20px 0 rgb(0 0 0 / 19%); */
    border-radius: 10px;
    &:hover {
      transition: all 0.3s linear;
      box-shadow:0 0 20px #cccccc;
    }
    .goods-detail-item-top {
      overflow: hidden;
      height: 160px;
      img {
        border-radius: 10px 10px;
        width: 100%;
      }
    }
  }
  /*.goods-detail-item:hover {*/
  /*  border: 1px solid #C0C4CC;*/
  /*  padding: 9px;*/
  /*}*/
  .price {
    color: orangered;
    font-weight: bolder;
    margin: 10px;
  }
  .title {
    font-size: 12px;
    margin-top: 20px;
  }
  .title a:hover {
    color: orangered;
  }
  .operate {
    margin-top: 20px;
    display: flex;
    align-items: center;
    a {
      width: 50%;
      height: 30px;
      line-height: 30px;
      font-size: 14px;
      color: #999999;
      cursor: pointer;
    }
    a:nth-of-type(1) {
      border-right: 1px solid antiquewhite;
    }
  }
</style>
